from core.basehandler import BaseHandler
from core.room import Room
from items.elevatorKeycard import ElevatorKeycard
from items.parachute import Parachute
from items.wyners import Wyners
from core.action import Action

class LubinOffice(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        self.add_item(ElevatorKeycard())
        self.add_item(Parachute())
        self.add_item(Wyners())
        # build list of actions
        self.add_action(Back)
        self.add_action(Forward)    
    
    # return description of room.
    def get_description(self):
        return "You are at Prof. Wyners' office and somehow HE IS STILL WORKING!!!"
    
    # return image of room
    def get_image(self):
        return 'wyners_office.jpg'


class Lubin_OfficeHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return LubinOffice

# define actions for this room

class Back(Action):
    def __init__(self):
        Action.__init__(self, "Back")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Race down the 6th floor hallway and back to the stairwell"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sixth_floor'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

class Forward(Action):
    def __init__(self):
        Action.__init__(self, "Forward")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the elevator"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'elevator'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
